home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / MarkzScout™ 14-day trial / Scripts / Document Dependencies.m1s < prev    next >
Encoding:
Text File  |  1999-02-23  |  2.8 KB  |  122 lines  |  [TEXT/MSCT]

  1. //
  2. // Document Dependencies.M1S: Show dependencies for documents & images
  3. // This script shows a list of all images and documents in a job and which
  4. // images they depend on (by linking). If a linked image gets a '*' in the left-hand
  5. // column it means that this image is structured itself and depends on other images.
  6. //
  7. // Example:
  8. //
  9. // doc1, doc2: QXPress docs that use an image DCS1
  10. // DCS1: DCS 1.0 image that uses plate files DCS1.C, DCS1.M,DCS1.Y,DCS1.K
  11. // When dragging a folder with these files onto this script, you get this:
  12. //
  13. //doc1
  14. //*   DCS1
  15. //    DCS1.C
  16. //    DCS1.K
  17. //    DCS1.M
  18. //    DCS1.Y
  19. //doc2
  20. //*   DCS1
  21. //    DCS1.C
  22. //    DCS1.K
  23. //    DCS1.M
  24. //    DCS1.Y
  25. //DCS1
  26. //    DCS1.C
  27. //    DCS1.K
  28. //    DCS1.M
  29. //    DCS1.Y
  30. //---------------------------------------
  31. //
  32. // This tells you that doc1 needs files DCS1, DCS1.C,... DCS1.Y. The '*' in front
  33. // of DCS1 below doc1 tells you that DCS1 is a structured image itself; at the
  34. // end we find DCS1, which needs files DCS1.C,...DCS1.Y.
  35. //
  36.  
  37. //
  38. // *************************************
  39. // Constants
  40. // *************************************
  41. // 
  42. cIndent = "   "
  43. cMaxLevel = 5
  44.  
  45. //
  46. // *************************************
  47. // Procedures
  48. // *************************************
  49. // 
  50. proc AddDocumentToList
  51.   docCount = docCount + 1
  52.   docTable[docCount]    = it
  53.   docNameTable[it.code] = docCount
  54.   docUsage[docCount,0] = 0
  55.   docLevel[docCount] = 0
  56. end proc
  57.  
  58. proc PrintLevelString
  59.   i_Level = 1
  60.   while i_Level < printLevel 
  61.     print cIndent;
  62.     i_Level = i_Level + 1
  63.   wend
  64.   print printString
  65. end proc
  66.  
  67. //
  68. // Remember that document 'it' is used by document 'docTable[docNum]'
  69. //
  70. proc MarkSubDocument
  71.   subDocNum = docNameTable[it.code]
  72.   if subDocNum <> docNum then
  73.     docUsage[docNum,0] = docUsage[docNum,0] + 1
  74.     docUsage[docNum,docUsage[docNum,0]] = subDocNum
  75.   end if
  76. end proc
  77.  
  78. //
  79. // *************************************
  80. // end Procedures
  81. // *************************************
  82. // 
  83.  
  84. //
  85. // Main 
  86. //
  87.  
  88. theJob = it
  89. docCount = 0
  90. on file do AddDocumentToList
  91. on job do AddDocumentToList
  92. scan theJob links uses, contains, overlaps, defines
  93. scan reset
  94.  
  95. on file do MarkSubDocument
  96. on job do MarkSubDocument
  97. docNum = 1
  98. while docNum <= docCount
  99.   scan docTable[docNum] links uses, contains, overlaps, defines
  100.   docNum = docNum + 1
  101. wend
  102. scan reset
  103.  
  104. docNum = 1
  105. while docNum <= docCount
  106.   if docNum = 1 or docUsage[docNum,0] > 0 then
  107.     print docTable[docNum].name
  108.     docPos = 1
  109.     while docPos <= docUsage[docNum,0]
  110.       subDocNum = docUsage[docNum,docPos]
  111.       if docUsage[subDocNum,0] > 0 then
  112.         print "*" + cIndent + docTable[subDocNum].name
  113.       else
  114.         print " " + cIndent + docTable[subDocNum].name
  115.       end if
  116.       docPos = docPos + 1       
  117.     wend
  118.   end if
  119.   docNum = docNum + 1 
  120. wend
  121. print "---------------------------------------"
  122.